package correct.day31;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        while (t-- != 0) {
            long n = scanner.nextLong();
            long a = scanner.nextLong();
            long b = scanner.nextLong();

            long ret = 0;
            if (n <= 2) {
                ret = Math.min(a, b);
            } else {
                if (3 * a < 2 * b) {
                    // 选2人船
                    long num = n / 2;
                    ret += num * a;
                    if (n % 2 == 1) {
                        ret += Math.min(Math.min(a, b), b - a);
                    }
                } else {
                    // 选3人船
                    long num = n / 3;
                    ret += num * b;
                    if (n % 3 == 1) {
                        ret += Math.min(Math.min(a, b), 2 * a - b);
                    }
                    if (n % 3 == 2) {
                        ret += Math.min(Math.min(a, b), 3 * a - b);
                    }
                }
            }
            System.out.println(ret);
        }
    }
}
